// 导入二次封装后的axis
import request from '@/utils/request'
// 获取品牌列表接口
// /admin/product/baseTrademark/getTrademarkList
export const reqTrademarkList = (page, limit) => {
    return request({ url: `/admin/product/baseTrademark/${page}/${limit}`, method: 'get' })
}

//添加品牌 POST /admin/product/baseTrademark/save ||修改品牌 PUT /admin/product/baseTrademark/update
// 
export const reqAddOrUpdateTradeMark = (tradeMark) => {
    // 如果参数对象中有id则代表请求的是修改品牌
    if (tradeMark.id) {
        return request({ url: '/admin/product/baseTrademark/update', data: tradeMark, method: 'put' })
    } else {
        return request({ url: '/admin/product/baseTrademark/save', data: tradeMark, method: 'post' })
    }
}

// 删除品牌 /admin/product/baseTrademark/remove/{id} delete
export const reqDeleteTradeMark=(id)=>{
    return request({url:`/admin/product/baseTrademark/remove/${id}`,method:'DELETE'})
}